Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
The method asList(T[]) in the type Arrays is not applicable for the arguments (int, int)

I am using jdk1.8.0_121 on eclipse kepler (My OS is windows 7), I have created a simple project contained one class with static main method.

When I tried to create a list as follow

List l = Arrays.asList(1,2);

I got this error :

The method asList(T[]) in the type Arrays is not applicable for the arguments (int, int).

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

In case anyone else comes across a similar issue, I found that I had this error because I was importing edu.emory.mathcs.backport.java.util.Arrays; instead of java.util.Arrays;

over 4 years ago · Santiago Trujillo Report

0

I have faced same issue like wrongly imported org.javers.common.collection.arrays So removed that one and imported from Utils Arrays got

over 4 years ago · Santiago Trujillo Report

0

I think you need to put an array as the parameter of asList. like:

int[] data = {1,2,3,4,5};
List list = Arrays.asList(data);
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!